import request from '@/utils/request'

export function list(query) {
    return request({
        url: '/mall/order/list',
        method: 'post',
        data: query
    })
}

export function down(query) {
    let config = {
        responseType: 'arraybuffer',
    }
    let url =  '/mall/order/down'
    return request.post(url,query,config)
}


export function upload(file) {
    let url = '/mall/order/upload';
    let forms = new FormData()
    forms.append("file",file)
    let config = {
        headers:{'Content-Type':'multipart/form-data'}
    }; //
    return request.post(url,forms,config)
}

export function downSend() {
    let config = {
        responseType: 'arraybuffer',
    }
    let url =  '/mall/order/down/send'
    return request.post(url,null,config)
}

export function resetWait() {
    let url =  '/mall/order/reset/wait'
    return request.post(url)
}

export function info(id) {
    return request({
        url: '/mall/order/info/' + id,
        method: 'get'
    })
}

export function save(data) {
    return request({
        url: '/mall/order/save',
        method: 'post',
        data
    })
}

export function update(data) {
    return request({
        url: '/mall/order/update',
        method: 'post',
        data
    })
}

export function remove(data) {
    return request({
        url: '/mall/order/delete',
        method: 'post',
        data
    })
}

